home *** CD-ROM | disk | FTP | other *** search
- <HTML>
- <HEAD>
- <LINK REL="stylesheet" TYPE="text/css" HREF="%1css/default.css">
-
- <script language="JavaScript" src="%1js/FormChek.js"></script>
-
- <script>
- // *************LOCALIZATION STRINGS*************
- var L_PRINTER_NAME_EMPTY = "The printer name/command cannot be empty.";
- var L_NOT_A_NUMBER_OR_ZERO = "The value must be a whole number greater than zero.";
- var L_TO_LESS_THAN_FROM = "The From page number must be equal or less than the To page number."
- </script>
-
- <SCRIPT>
- var oldLayout = "%11";
- var canDisableNames = true;
-
- function Init()
- {
- document.layoutform.layout.value = "%11";
-
- // remap default printer to specific printer
- if ( oldLayout == "1" )
- oldLayout = "3";
-
- // remap no printer to custom
- if ( oldLayout == "2" )
- oldLayout = "4";
-
- // allow name selection to be enabled.
- if ( oldLayout == "3" )
- canDisableNames = false;
-
- var i;
- for ( i = 0; i < document.layoutform.layoutsel.length; i++)
- {
- if ( document.layoutform.layoutsel.options[i].value == oldLayout )
- {
- document.layoutform.layoutsel.selectedIndex = i;
- break;
- }
- }
-
- if ( oldLayout == "3" || oldLayout == "4" )
- InitExtra();
-
- // init printing
- OnEnablePrinter();
- }
-
- function OnChangeLayout(d)
- {
- if ( !CheckPrintWhenScheduling() )
- return;
-
- document.layoutform.layout.value = document.layoutform.layoutsel.value;
- document.layoutform.action = "%2";
- document.layoutform.submit();
- }
-
- function OnSetPrinterNameDisabled()
- {
- document.layoutform.printername.disabled = document.layoutform.usedefaultprinter[0].checked;
- }
-
- function OnEnablePrinter()
- {
- var isDisabled = !document.layoutform.enableprinterchk.checked;
-
- if ( canDisableNames )
- {
- document.layoutform.usedefaultprinter[0].disabled = isDisabled;
- document.layoutform.usedefaultprinter[1].disabled = isDisabled;
-
- if ( isDisabled )
- document.layoutform.printername.disabled = isDisabled;
- else
- OnSetPrinterNameDisabled();
- }
-
- document.layoutform.copies.disabled = isDisabled;
- document.layoutform.pages[0].disabled = isDisabled;
- document.layoutform.pages[1].disabled = isDisabled;
-
- OnSetPageRange();
- }
-
- function OnSetPageRange()
- {
- var isDisabled = ( document.layoutform.pages[0].checked || !document.layoutform.enableprinterchk.checked);
-
- document.layoutform.from.disabled = isDisabled;
- document.layoutform.to.disabled = isDisabled;
- }
-
- function CheckPrintWhenScheduling()
- {
- // enable printing
- if ( document.layoutform.enableprinterchk.checked )
- document.layoutform.enableprinter.value = "true";
- else
- document.layoutform.enableprinter.value = "false";
-
- if ( document.layoutform.enableprinterchk.checked )
- {
- // check empty printer name
- if ( ( oldLayout != "3") && ( document.layoutform.usedefaultprinter[1].checked ) )
- {
- if ( document.layoutform.printername.value == "" )
- {
- alert( L_PRINTER_NAME_EMPTY );
-
- document.layoutform.printername.focus();
- document.layoutform.printername.select();
-
- return false;
- }
- }
-
- var testNum1;
- var testNum2;
-
- // check number of copies
- testNum1 = document.layoutform.copies.value;
-
- if ( !isPositiveInteger(testNum1) )
- {
- alert( L_NOT_A_NUMBER_OR_ZERO );
- document.layoutform.copies.focus();
- document.layoutform.copies.select();
-
- return false;
- }
-
- // check range
- if ( document.layoutform.pages[1].checked )
- {
- testNum1 = document.layoutform.from.value;
- testNum2 = document.layoutform.to.value;
-
- // from not a valid number
- if ( !isPositiveInteger(testNum1) )
- {
- alert( L_NOT_A_NUMBER_OR_ZERO );
- document.layoutform.from.focus();
- document.layoutform.from.select();
-
- return false;
- }
-
- // to not a valid number
- if ( !isPositiveInteger(testNum2) )
- {
- alert( L_NOT_A_NUMBER_OR_ZERO );
- document.layoutform.to.focus();
- document.layoutform.to.select();
-
- return false;
- }
-
- testNum1 = Number(testNum1);
- testNum2 = Number(testNum2);
-
- // to less than from
- if ( testNum2 < testNum1 )
- {
- alert( L_TO_LESS_THAN_FROM );
- document.layoutform.from.focus();
- document.layoutform.from.select();
-
- return false;
- }
- }
- }
-
- return true;
- }
-
- function SubmitForm()
- {
- var layoutVal = document.layoutform.layoutsel.options[document.layoutform.layoutsel.selectedIndex].value;
-
- document.layoutform.layout.value = layoutVal;
-
- // if specific printer, validate
- if ( oldLayout == "3" )
- if ( !CheckSpecifiedPrinter() )
- return;
-
- // if custom, validate.
- if ( oldLayout == "4" )
- if ( !CheckCustom() )
- return;
-
- // validate printing
- if ( !CheckPrintWhenScheduling() )
- return;
-
- document.layoutform.submit();
- }
-
- function ResetForm()
- {
- document.location.replace("%2");
- }
- </SCRIPT>
-
- </HEAD>
- <BODY LEFTMARGIN="5" RIGHTMARGIN="5" onload='Init()'>
-
- <DIV ID="tooltip" STYLE="position:absolute;visibility:hidden;z-index:99;"></DIV>
- <SCRIPT SRC="%1js/helps.js"></SCRIPT>
- <SCRIPT SRC="%1js/tips.js"></SCRIPT>
-
- <form name="layoutform" method=POST action="%3" onsubmit="return false;">
- <span class='listSelected'>Print when scheduling</span><br>
- When page layout is set to "Specified printer settings", printing can only be done on the same printer set in page layout.<br>
- <table><tr><td><!--spacer--></td></tr></table>
- <center>
- <table width='90%' border=0>
- <tr>
- <td class='list'>
- <table border=0 cellspacing=5 cellpadding=0>
- <tr>
- <td class='list' valign='middle'>
- <input type="checkbox" name="enableprinterchk" %5 onClick="JavaScript:OnEnablePrinter();">
- <input type="hidden" name="enableprinter">
- </td>
- <td class='list'>
- Print in Crystal Reports format using the selected printer when scheduling.
- </td>
- </tr>
- %4
- <tr>
- <td class='list'>
-
- </td>
- <td calss='list'>
- <table border=0 cellpadding=4 cellspacing=0>
- <tr>
- <td class="list" valign="top" nowrap>
- <table border=0 cellpadding=0 cellspacing=0>
- <tr>
- <td class='list'>
- Number of Copies:
- </td>
- <td class='list'>
- <input type='text' size='3' name='copies' value='%6'>
- </td>
- <td class="list">
-
- </td>
- <td class='list'>
- Page Range:
- </td>
- <td class='list'>
- <input type='radio' name='pages' value='all' %7 onClick="JavaScript:OnSetPageRange();">
- All
- </td>
- </tr>
- <tr>
- <td class="list" colspan=4>
-
- </td>
- <td class='list'>
- <input type='radio' name='pages' value='range' nowrap %8 onClick="JavaScript:OnSetPageRange();">
- Pages from: <input type='text' size='3' name='from' value='%9' align=middle> to: <input type='text' size='3' name='to' value='%10' align=middle>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </center>
-
- <p>
-
- <span class='listSelected'>Set the report's page layout.</span><br>
- The page layout will be applied to all formats.
- <p>
-
- <center>
- <table width='90%' border=0>
- <tr>
- <td class='list'>
- <table border=0 cellpadding=5 cellspacing=0>
- <tr>
- <td class='list'>
- Set layout to:
- </td>
- <td class='list'>
- <select name='layoutsel' class='menuFormElement' onchange='OnChangeLayout(this.options[this.selectedIndex].value);'>
- <option value='0' selected>Report file default
- <option value='3'>Specified printer settings
- <option value='4'>Custom settings
- </select>
- <input type=hidden name="layout">
- </td>
- </tr>
- %12
- </table>
- </td>
- </tr>
- </table>
-
- <p>
-
- </form>
- </center>
-
- <table align="right" border=0 cellpadding=0>
- <tr valign=center>
- <td class="clsButton" align=middle nowrap>
- <div class="clsButton"><a href="javascript: SubmitForm()" onMouseOver="St(7);window.status='';return true;" onMouseOut="Ht()">Update</a></div>
- </td>
- <td class="clsButton" align=middle nowrap>
- <div class="clsButton"><a href="javascript: ResetForm()" onMouseOver="St(8);window.status='';return true;" onMouseOut="Ht()">Reset</a></div>
- </td>
- </tr>
- </table>
-
- </BODY>
- </HTML>
-